<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="resource/js/vue.js"></script>
</head>
<body>
<div id="demo">
    {{fullName}}
</div>
<script>
    var vm = new Vue({
        el: '#demo',
        data:{
            firstName: 'Foo',
            lastName: 'Bar'
        },
        computed: {
            fullName: {
                get: function(){
                    return this.firstName + ' ' + this.lastName
                },
                set: function(newValue){
                    var names = newValue.split(' ')
                    this.firstName = names[0]
                    this.lastName = names[names.length - 1]
                }
            }
        }
    })
</script>

</body>
</html>